package com.ytktt.study.week9.task3.rpcfx.api.resolver;

import com.ytktt.study.week9.task3.rpcfx.api.RpcfxResolver;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * Demo解析器
 *
 * @author ytk
 */
public class DemoResolver implements RpcfxResolver, ApplicationContextAware {

    private ApplicationContext applicationContext;

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) {
        this.applicationContext = applicationContext;
    }

    @Override
    public Object resolve(String beanName) {
        return this.applicationContext.getBean(beanName);
    }
}
